package main;

import java.util.HashSet;
import java.util.Set;

public class Tester {

	public static void main(String[] args) {
		Set<Tricou> shirts = new HashSet<Tricou>();
		Tricou first = new Tricou(1, "murdar", "galben", "M", 10);
		Tricou second = new Tricou(2, "nou", "rosu", "L", 3);
		Tricou third = new Tricou(3, "nu stiu", "albastru", "S", 5);
		Tricou fourth = new Tricou(4, "nu mai stiu", "negru", "XL", 3);
		Tricou fifth = new Tricou(5, "chiar nu stiu", "alb", "XS", 2);
		Tricou sixth = new Tricou(6, "","","",3);
		shirts.add(first);
		shirts.add(second);
		shirts.add(third);
		shirts.add(fourth);
		shirts.add(fifth);

		OpTricouri operator = new OpTricouri(shirts);

		System.out.println(operator.showAll());
		try{
		operator.doOperation(first, TranzactionType.SELL, 5);
		}
		catch (InvalidShirtException e) 
		{
			e.printStackTrace();
		}
		System.out.println("Am vandut din primul tricou");
		
		System.out.println(operator.showAll());
		
		try {
			operator.doOperation(second, TranzactionType.BUY,10);
		} catch (InvalidShirtException e) {
			// TODO Auto-generated catch block
			System.out.println(e.getMessage());
		}
		
		System.out.println("Am cumparat pentru al 2-lea tricou");
		
		System.out.println(operator.showAll());
		
		try {
			operator.doOperation(sixth, TranzactionType.BUY,10);
		} catch (InvalidShirtException e) {
			// TODO Auto-generated catch block
			System.out.println(e.getMessage());
		}
		System.out.println("Raport dupa cantitate");
		System.out.println(operator.reportQuantity());
		System.out.println("Raport dupa descriere");
		System.out.println(operator.reportDescription());
		
	}

}
